package cn.com.infosec.ra.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.springframework.web.context.support.WebApplicationContextUtils;

import cn.com.infosec.ra.util.Const;
import cn.com.infosec.ra.util.SystemInit;


public class WebAppContextListener implements ServletContextListener {

	public void contextDestroyed(ServletContextEvent event) {
	}

	public void contextInitialized(ServletContextEvent event) {
		Const.WEB_APP_CONTEXT = WebApplicationContextUtils.getWebApplicationContext(event.getServletContext());
		try {
			SystemInit.getInstance();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
